package cn.com.victorysoft.ylgl.service.commons.mybatis.paging.bean;

import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/***
 * @author gechaoqing
 * @param <T>
 */
@Data
public class DataPaging<T> implements Serializable {
    private List<T> rows = new ArrayList<>();
    private int total;

    public DataPaging(Collection<T> rows, int total) {
        this.rows.addAll(rows);
        this.total = total;
    }

    @Override
    public String toString() {
        return (new ToStringBuilder(this)).append("total", this.total).append("rows", this.rows).toString();
    }
}
